Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

RUSshy

🌴
On vacation
View GitHub Profile
View time.d
module time;
ulong ticks()
{
version (Windows)
{
import core.sys.windows.windows : QueryPerformanceCounter;
import core.sys.windows.windows : LARGE_INTEGER;
View _sample.d
struct CTransform
{
mixin Component;
int x;
int y;
int z;
}
struct CVelocity
View ecs.h
#pragma once
#include <vector>
struct CType
{
int type;
};
struct CPlayer
View ecs.h
#pragma once
#include <entt/entt.hpp>
#include <vector>
struct CType
{
int type;
};
View log.txt
Build with surface heuristics started at 15:41:10
Use build tool: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
CONSOLE: Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
CONSOLE: Copyright (C) Microsoft Corporation. All rights reserved.
CONSOLE: Build started 6/16/2020 3:41:12 PM.
0>------- Started building project: server
0>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\CL.exe /c /I..\projects\game\server\src /I..\libs\enet\include /I..\projects\game\shared\src /I..\projects\arc\src /ZI /JMC /nologo /W3 /WX- /diagnostics:column /Od /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++17 /Fo"..\build\obj\server\Debug\\" /Fd"..\build\obj\server\Debug\vc142.pdb" /Gd /TP /FC /errorReport:prompt /MP /MD /fastlink /debug:fastlink ..\projects\game\server\src\Map.cpp ..\projects\game\server\src\MyServer.cpp ..\projects\game\server\src\main.
View server.cpp
void NetServer::run_loop()
{
for (const auto& pair : id_to_con)
{
auto now = sw.elapsed_ms();
auto* connection = pair.second;
if (connection->state == State::Disconnected)
{
// remove
connections_to_erase.emplace_back(pair.first);
View Input.cs
public enum Keys
{
ANY_KEY = -1,
NUM_0 = 7,
NUM_1 = 8,
NUM_2 = 9,
NUM_3 = 10,
NUM_4 = 11,
NUM_5 = 12,
NUM_6 = 13,
View Pg.cs
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using Oid = System.UInt32;
using pqbool = System.Byte;
using pg_int64 = System.Int64;
namespace Arc.Bindings.PostgreSql
{
View DBConnection.cs
public class DBConnection : IDisposable
{
private IntPtr _connection;
public void connect(string host, string user, string pass, string db)
{
var connectionStr = $"host={host} dbname={db} user={user} password={pass} client_encoding=utf8";
_connection = Pg.PQconnectdb(connectionStr);
if (Pg.PQstatus(_connection) != Pg.ConnStatusType.CONNECTION_OK)
View DBConnection.cs
public class DBConnection : IDisposable
{
private IntPtr _connection;
public void connect(string host, string user, string pass, string db)
{
var connectionStr = $"host={host} dbname={db} user={user} password={pass} client_encoding=utf8";
_connection = Pg.PQconnectdb(connectionStr);
if (Pg.PQstatus(_connection) != ConnStatusType.CONNECTION_OK)
{