daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <time.h>
  2. #include <stdint.h>
  3. #include <vector>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include "Player.h"
  7.  
  8. #ifndef _H_GLOBAL
  9. #define _H_GLOBAL
  10. typedef uint8_t byte;
  11. enum clientPackets {
  12.     CNewAccount = 1,
  13.     CDelAccount,
  14.     CLogin,
  15.     CAddChar,
  16.     CUseChar,
  17.     CSayMsg,
  18.     CEmoteMsg,
  19.     CBroadcastMsg,
  20.     CPlayerMsg,
  21.     CPlayerMove,
  22.     CPlayerDir,
  23.     CUseItem,
  24.     CAttack,
  25.     CUseStatPoint,
  26.     CPlayerInfoRequest,
  27.     CWarpMeTo,
  28.     CWarpToMe,
  29.     CWarpTo,
  30.     CSetSprite,
  31.     CGetStats,
  32.     CRequestNewMap,
  33.     CMapData,
  34.     CNeedMap,
  35.     CMapGetItem,
  36.     CMapDropItem,
  37.     CMapRespawn,
  38.     CMapReport,
  39.     CKickPlayer,
  40.     CBanList,
  41.     CBanDestroy,
  42.     CBanPlayer,
  43.     CRequestEditMap,
  44.     CRequestEditItem,
  45.     CRequestEditNpc,
  46.     CRequestEditShop,
  47.     CRequestEditSpell,
  48.     CRequestEditResource,
  49.     CRequestEditAnimation,
  50.     CSaveData,
  51.     CSetAccess,
  52.     CWhosOnline,
  53.     CSetMotd,
  54.     CSearch,
  55.     CSpells,
  56.     CCast,
  57.     CQuit,
  58.     CSwapInvSlots,
  59.     CCheckPing,
  60.     CUnequip,
  61.     CRequestPlayerData,
  62.     CRequestItems,
  63.     CRequestNPCS,
  64.     CRequestResources,
  65.     CRequestAnimations,
  66.     CSpawnItem,
  67.     CRequestSpells,
  68.     CRequestShops,
  69.     CRequestLevelUp,
  70.     CForgetSpell,
  71.     CCloseShop,
  72.     CBuyItem,
  73.     CSellItem,
  74.     CChangeBankSlots,
  75.     CDepositItem,
  76.     CWithdrawItem,
  77.     CCloseBank,
  78.     CAdminWarp,
  79.     CTradeRequest,
  80.     CAcceptTrade,
  81.     CDeclinetrade,
  82.     CTradeItem,
  83.     CUntradeItem,
  84.     CHotbarChange,
  85.     CSwapSpellSlots,
  86.     CAcceptTradeRequest,
  87.     CDeclineTradeRequest,
  88.     CPartyRequest,
  89.     CAcceptParty,
  90.     CDeclineParty,
  91.     CPartyLeave,
  92.  
  93.     // Packet Count
  94.     CMSG_COUNT
  95. };
  96.  
  97. enum serverPackets {
  98.     SAlertMsg = 1,
  99.     SLoginOk,
  100.     SNewCharClasses,
  101.     SClassesData,
  102.     SInGame,
  103.     SPlayerInv,
  104.     SPlayerInvUpdate,
  105.     SPlayerWornEq,
  106.     SPlayerHp,
  107.     SPlayerMp,
  108.     SPlayerStats,
  109.     SPlayerData,
  110.     SPlayerMove,
  111.     SNpcMove,
  112.     SPlayerDir,
  113.     SNpcDir,
  114.     SPlayerXY,
  115.     SPlayerXYMap,
  116.     SAttack,
  117.     SNpcAttack,
  118.     SCheckForMap,
  119.     SMapData,
  120.     SMapItemData,
  121.     SMapNpcData,
  122.     SMapDone,
  123.     SGlobalMsg,
  124.     SAdminMsg,
  125.     SPlayerMsg,
  126.     SMapMsg,
  127.     SSpawnItem,
  128.     SDataEditor,
  129.     SUpdateItem,
  130.     SSpawnNpc,
  131.     SNpcDead,
  132.     SUpdateNpc,
  133.     SMapKey,
  134.     SUpdateShop,
  135.     SUpdatespell,
  136.     SSpells,
  137.     SLeft,
  138.     SResourceCache,
  139.     SUpdateResource,
  140.     SSendPing,
  141.     SDoorAnimation,
  142.     SActionMsg,
  143.     SPlayerEXP,
  144.     SBlood,
  145.     SUpdateAnimation,
  146.     SAnimation,
  147.     SMapNpcVitals,
  148.     SCooldown,
  149.     SClearSpellBuffer,
  150.     SSayMsg,
  151.     SOpenShop,
  152.     SResetShopAction,
  153.     SStunned,
  154.     SMapWornEq,
  155.     SBank,
  156.     STrade,
  157.     SCloseTrade,
  158.     STradeUpdate,
  159.     STradeStatus,
  160.     STarget,
  161.     SHotbar,
  162.     SHighIndex,
  163.     SSound,
  164.     STradeRequest,
  165.     SPartyInvite,
  166.     SPartyUpdate,
  167.     SPartyVitals,
  168.  
  169.     // Packet Count
  170.     SMSG_COUNT
  171. };
  172.  
  173. enum Directions {
  174.     DIR_UP,
  175.     DIR_DOWN,
  176.     DIR_LEFT,
  177.     DIR_RIGHT
  178. };
  179.  
  180. std::vector<char*> sLog;
  181.  
  182.  
  183. void print(char* s) {
  184.     char* msg = (char*)calloc(256, 1);
  185.     time_t tim = time(0);
  186.     struct tm * now = localtime(&tim);
  187.  
  188.     sprintf(msg, "[%d:%d:%d] %s", now->tm_hour, now->tm_min, now->tm_sec, s);
  189.  
  190.     sLog.push_back(msg);
  191.     free(msg);
  192. }
  193.  
  194. namespace GameData {
  195.     namespace Constants {
  196.         const int MAX_PLAYERS = 200;
  197.     }
  198.  
  199.     namespace Total {
  200.         int players;
  201.         int items;
  202.         int spells;
  203.         int banks;
  204.         int maps;
  205.         int npcs;
  206.         int shops;
  207.     }
  208.     Player plr[Constants::MAX_PLAYERS];
  209. }
  210. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top