Shadowrun: Awakened 29 September 2011 - Build 871
DbProcedures.h
Go to the documentation of this file.
00001 #ifndef __SRADATA_DBPROCEDURES_H
00002 #define __SRADATA_DBPROCEDURES_H
00003 
00004 #include "stdafx.h"
00005 
00006 #include <stdio.h>
00007 #include <stdlib.h>
00008 #include <iostream>
00009 #include <map>
00010 #include <memory>
00011 #include <Stdint.h>
00012 
00013 #include <cppconn/driver.h>
00014 #include <cppconn/exception.h>
00015 #include <cppconn/resultset.h>
00016 #include <cppconn/statement.h>
00017 #include <cppconn/prepared_statement.h>
00018 
00019 #include "DbConnectionFactory.h"
00020 
00026 INLINE std::string formatString(const char *format, int id)
00027 {
00028     //get the total size of the format
00029     int count = _scprintf(format, id);
00030     char* buff = NULL;
00031     try
00032     {
00033         //allocate a buffer
00034         buff = new char[count + 1];
00035         //format the string and put it in there
00036         _snprintf(buff, count + 1, format, id);
00037     }
00038     catch (...)
00039     {
00040     }
00041 
00042     if(buff == NULL)
00043         return std::string();
00044     else
00045     {
00046         std::string ret(buff);
00047         delete[] buff;
00048         return ret;
00049     }
00050 }
00051 
00052 namespace SraData
00053 {
00058 class DbProcedures
00059 {
00060     public:
00061         static __declspec(dllexport) void clearCharQuality(int pInCharId, int pInQualityId);
00062         static __declspec(dllexport) void clearCharSpell(int pInCharId, int pInSpellId);
00063         static __declspec(dllexport) void createCharacter(int pInRaceId, int* pOutId);
00064         static __declspec(dllexport) void createGearItem(int pInGearId, int pInOwnerCharId, int pInRating, int* pOutGearItemId);
00065         static __declspec(dllexport) void createPlayer(const std::string& pInLogin, const std::string& pInPassword, int* pOutId);
00066         static __declspec(dllexport) void createPlayerCharacter(int pInRaceId, int pInPlayerId, int* pOutPcId, int* pOutCharId);
00067         static __declspec(dllexport) void deleteGearItem(int pInGearItemId);
00068         static __declspec(dllexport) void getChar(int pInCharId, bool* isMale, int* raceId, int* agility, int* body, int* reaction, int* strength, int* charisma, int* intuition, int* logic, int* willpower, int* edge, int* edgeBurnt, int* magic, int* resonance, int* queryId);
00069         static __declspec(dllexport) void getCharActiveSkills(int pInCharId, int* activeSkillId, int* rating, int* queryId);
00070         static __declspec(dllexport) void getCharAdeptPwrs(int pInCharId, int* adeptPowerId, int* rating, int* queryId);
00071         static __declspec(dllexport) void getCharDmg(int pInCharId, int* stunDmgTaken, int* physicalDmgTaken, int* queryId);
00072         static __declspec(dllexport) void getCharGear(int pInCharId, int* gearId, int* location, int* rating, int* queryId);
00073         static __declspec(dllexport) void getCharKnowSkills(int pInCharId, int* knowledgeSkillId, int* rating, int* queryId);
00074         static __declspec(dllexport) void getCharQualities(int pInCharId, int* qualityId, int* rating, int* queryId);
00075         static __declspec(dllexport) void getCharSpells(int pInCharId, int* spellId, int* queryId);
00076         static __declspec(dllexport) void getPcZone(int pInPcId, int* currentZoneId, int* queryId);
00077         static __declspec(dllexport) void getPlayerCharacters(int pInPlayerId, int* ID, int* queryId);
00078         static __declspec(dllexport) void setCharActiveSkill(int pInCharId, int pInSkillId, int pInRating);
00079         static __declspec(dllexport) void setCharAdeptPwr(int pInCharId, int pInPwrId, int pInRating);
00080         static __declspec(dllexport) void setCharDmg(int pInCharId, int pInStunDmg, int pInPhysDmg);
00081         static __declspec(dllexport) void setCharKnowSkill(int pInCharId, int pInSkillId, int pInRating);
00082         static __declspec(dllexport) void setCharMentAttr(int pInCharId, int pInCharisma, int pInIntuition, int pInLogic, int pInWillpower);
00083         static __declspec(dllexport) void setCharPhysAttr(int pInCharId, int pInAgility, int pInBody, int pInReaction, int pInStrength);
00084         static __declspec(dllexport) void setCharQuality(int pInCharId, int pInQualityId, int pInRating);
00085         static __declspec(dllexport) void setCharSpecAttr(int pInCharId, int pInEdge, int pInEdgeBurnt, int pInMagic, int pInResonance);
00086         static __declspec(dllexport) void setCharSpell(int pInCharId, int pInSpellId);
00087         static __declspec(dllexport) void setGearItemOwner(int pInGearId, int pInOwnerCharId);
00088         static __declspec(dllexport) void setPcZone(int pInPcId, int pInZoneId);
00089         static __declspec(dllexport) void setPlayerNickname(int pInPlayerId, const std::string& pInNickname);
00090     };
00091 }
00092 
00093 #endif

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net