~ubuntu-branches/debian/sid/monopd/sid

« back to all changes in this revision

Viewing changes to src/server.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2011-07-18 22:07:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110718220744-bg6e0yij97p8xxno
Tags: 0.9.3-5
* Orphaning package (see #634499).
* Bump Standards-Version to 3.9.2.
* Update to 3.0 (quilt) source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <netinet/in.h>
26
26
#include <syslog.h>
27
27
#include <unistd.h>
 
28
#include <stdlib.h>
 
29
#include <string.h>
28
30
 
29
31
#include <string>
30
32
 
791
793
                        switch(data[1])
792
794
                        {
793
795
                        case 'n':
794
 
                                pNew = newPlayer(socket, data.substr(2));
 
796
                                pNew = newPlayer(socket, data.substr(2, 16));
795
797
                                sendXMLUpdates();
796
798
                                sendXMLUpdate(pNew, true, true); // give new player a full update (excluding self) so it knows who's in the lounge
797
799
                                return;
832
834
        switch(data[0])
833
835
        {
834
836
        case 'n':
835
 
                setPlayerName(pInput, std::string(data+1));
 
837
                setPlayerName(pInput, data2.substr(1, 16));
836
838
                return;
837
839
        case 'p':
838
840
                switch(data[1])
839
841
                {
840
842
                        case 'i':
841
 
                                pInput->setProperty("image", data+2, this);
 
843
                                pInput->setProperty("image", data2.substr(2, 32), this);
842
844
                                return;
843
845
                }
844
846
                break;
1132
1134
                        switch(data[1])
1133
1135
                        {
1134
1136
                                case 'd':
1135
 
                                        setGameDescription(pInput, data2.substr(2));
 
1137
                                        setGameDescription(pInput, data2.substr(2, 64));
1136
1138
                                        return;
1137
1139
                                case 'c':
1138
1140
                                        game->editConfiguration( pInput, data+2 );