Skip to content

Instantly share code, notes, and snippets.

View apathyboy's full-sized avatar

Eric Barr apathyboy

View GitHub Profile
#include <cstdint>
#include <algorithm>
#include <iostream>
#include <limits>
namespace anh {
namespace detail {
/// @TODO Remove quotes from around constexpr when visual studio begins
/// supporting that c++0x feature.
/*
This file is part of MMOServer. For more information, visit http://swganh.com
Copyright (c) 2006 - 2010 The SWG:ANH Team
MMOServer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@echo off
SETLOCAL EnableDelayedExpansion
set "DEPS_BASE=%~dp0"
set "DEPS_DRIVE=%~d0"
%PROJECT_DRIVE%
cd %DEPS_BASE%
rem Build the environment and bail out if it fails
/// When creating an instance of ServerDirectory with an invalid cluster name
/// an InvalidCluster exception is thrown.
TEST_F(ServerDirectoryTest, JoiningInvalidClusterThrowsException) {
auto datastore = make_shared<MockDatastore>();
EXPECT_CALL(*datastore, findClusterByName("bad_cluster"))
.WillOnce(Return(nullptr));
try {
ServerDirectory server_directory(datastore, "bad_cluster", "20050408-18:00");
FAIL() << "An exception should be thrown when given an invalid cluster name";
/*
This file is part of SWGANH. For more information, visit http://swganh.com
Copyright (c) 2011 ANH Studios
SWGANH is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: build_server.bat
::
:: Build's the project and produces a directory of all necesary executables and
:: dll's needed to run an instance of the server.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: initialize build variables
<?php
namespace Sub6\PilotNocBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @orm:Entity
* @orm:Table(name="server")
*/
class Server
@apathyboy
apathyboy / main.cc
Created April 11, 2011 10:03
Testing tbb pipeline
/*
This file is part of ANHServer. For more information, visit http://swganh.com
Copyright (c) 2010 - 2011 ANH Studios
ANHServer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@apathyboy
apathyboy / setup.sh
Created May 3, 2011 19:15
Quickly reloads the swganh database on unix environment: ./setup.sh -u mysql_username -p mysql_password
#!/bin/bash
# Get the directory this file is in (the project base)
basedir=$(cd $(dirname $0) && pwd)
mysql=mysql # mysql executable
username= # mysql user
passwd= # mysql password
# parse the command line parameters
bool LoginManager::authenticateClient_(
LoginClient* client,
const std::string& username,
const std::string& password) const
{
shared_ptr<sql::Connection> conn = database_manager_->getConnection("default");
shared_ptr<sql::PreparedStatement> stmt(
conn->prepareStatement("CALL sp_ReturnUserAccount(?, ?)")
);