Changeset 46fa35a in network-game for server


Ignore:
Timestamp:
May 26, 2013, 8:27:54 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
e1f78f5
Parents:
d09fe76
Message:

The server randomly chooses a player's class when they log on

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rd09fe76 r46fa35a  
    417417            // choose a random team (either 0 or 1)
    418418            p->team = rand() % 2;
     419
     420            // choose a random class
     421            int intClass = rand() % 2;
     422            switch (intClass) {
     423               case 0:
     424                  p->setClass(Player::CLASS_WARRIOR);
     425                  break;
     426               case 1:
     427                  p->setClass(Player::CLASS_RANGER);
     428                  break;
     429            }
    419430
    420431            // tell the new player about all the existing players
Note: See TracChangeset for help on using the changeset viewer.