Skip to content

Instantly share code, notes, and snippets.

View Kronos11's full-sized avatar

Kyle Kronos11

  • Liberty Mutual
  • Liberty Lake, WA, United States
  • X @KyleGameDev
View GitHub Profile
@Kronos11
Kronos11 / ScriptComponent
Created January 30, 2011 08:20
Psuedo code for a ScriptComponent
class ScriptComponent {
struct {
std::string name;
std::string file_name;
std::shared_ptr<IEvent> on_event;
}SCRIPTDATA;
SCRIPTDATA[] scripts;
}
@Kronos11
Kronos11 / packetLayouts
Created June 4, 2011 19:49
Packet Layout
namespace packets {
struct BasePacket
{
BasePacket(){}
explicit BasePacket(uint32_t session_, uint32_t crc_)
, session(session_)
, crc(crc_)
{}
uint32_t session;
uint32_t crc;
@Kronos11
Kronos11 / gist:1008368
Created June 4, 2011 21:10
Base packet
struct DataChannelMessage
{
DataChannelMessage(uint32_t session_id_, anh::ByteBuffer& data_)
: session_id(session_id_)
, data(data_)
{}
uint32_t session_id;
anh::ByteBuffer data;
};
@Kronos11
Kronos11 / gist:1008402
Created June 4, 2011 21:56
LoginClientToken
struct LoginClientToken
{
LoginClientToken(anh::ByteBuffer& buffer)
{
deserialize(buffer);
}
LoginClientToken(anh::ByteBuffer session_key_, int32_t account_id_, std::string account_username_)
: session_key(session_key_)
, account_id(account_id_)
, account_username(account_username_)
@Kronos11
Kronos11 / gist:1015097
Created June 8, 2011 19:02
BaseANHPacket
template<typename T>
struct BaseANHPacket {
// header
uint16_t priority;
uint32_t time_stamp;
uint32_t process_id;
void serialize(anh::ByteBuffer& buffer) const {
buffer.write(priority);
buffer.write(time_stamp);
@Kronos11
Kronos11 / gist:1016128
Created June 9, 2011 05:42
build then open sln
cd S:/swganh/build/
cmake -DVENDOR_PREFIX=$PWD/../../vendor ..
cd src
explorer swganh.sln
@Kronos11
Kronos11 / gist:1039510
Created June 22, 2011 04:42
account table
delimiter $$
CREATE TABLE `accounts` (
`account_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Account ID',
`account_username` char(32) NOT NULL DEFAULT '' COMMENT 'Account username',
`account_password` char(64) NOT NULL COMMENT 'Account password',
`account_station_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Account STATION_ID',
`account_level` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Account - CSR Flag',
`account_banned` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Account - Banned Status',
`account_email` char(64) NOT NULL DEFAULT '' COMMENT 'Account - User email',
@Kronos11
Kronos11 / gist:1041680
Created June 23, 2011 01:09
entire account table with stored procs
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.1.48-community
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@Kronos11
Kronos11 / gist:1086798
Created July 16, 2011 21:12
test component structure
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@Kronos11
Kronos11 / gist:1103260
Created July 24, 2011 23:56
CREO1 idea
#include <algorithm>
#include "swganh/base/swg_message.h"
#include "swganh/base/data/bank.h"
#include "swganh/base/data/ham.h"
#include "swganh/base/data/skills.h"
// Originates on Server
namespace swganh {
namespace scene {