![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 /* 00002 * BasicCharacterInfo - Baisc information about a player character. 00003 * 00004 * @Author Michael <Tharbas> Matzen 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the Free 00008 * Software Foundation; either version 2 of the License, or (at your option) 00009 * any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT 00012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00014 * more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along with 00017 * this program; if not, write to the Free Software Foundation, Inc., 51 00018 * Franklin St, Fifth Floor, Boston, MA 02110, USA 00019 * 00020 */ 00021 00022 #pragma once 00023 00024 #include "NetworkHelper.h" 00025 #include "SraNetworkShared.h" 00026 #include <string> 00027 00028 namespace SraNetwork 00029 { 00030 struct BasicCharacterInfo 00031 { 00032 static const int PACKAGE_SIZE = 3 * sizeof(int) + MAX_STRLEN; 00033 00034 int charId; 00035 RakNet::RakString charName; 00036 int raceId; 00037 int charLevel; 00038 00039 void Serialize(RakNet::BitStream* target) 00040 { 00041 target->Write<int>(charId); 00042 target->Write<int>(raceId); 00043 target->Write<int>(charLevel); 00044 target->Write<RakNet::RakString>(charName); 00045 } 00046 00047 void Deserialize(RakNet::BitStream* source) 00048 { 00049 source->Read<int>(charId); 00050 source->Read<int>(raceId); 00051 source->Read<int>(charLevel); 00052 source->Read<RakNet::RakString>(charName); 00053 } 00054 }; 00055 }
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.