Skip to content

Instantly share code, notes, and snippets.

protected virtual void OnStartGame()
{
Console.WriteLine("OnStartGame");
Trace.Listeners.Add(new TextWriterTraceListener(@"c:\temp\calls.log"));
if (GameStarted != null)
{
// Crazy and terrible workaround
// Somehow doing stuff at this stage, like spawning entities, will happen to soon, and not show up ingame at all
// If we sleep a bit it should all work fine
// PLEASE FIX THIS SOME TIME
--------------------------------------------------------------------------
-- Crytek Source File.
-- Copyright (C), Crytek Studios, 2001-2004.
--------------------------------------------------------------------------
-- $Id$
-- $DateTime$
-- Description: GameRules implementation for Death Match
--
--------------------------------------------------------------------------
-- History:
var methodInfo = scriptInstance.GetType().GetMethods().First(method =>
{
var parameters = method.GetParameters();
if (method.Name == func)
{
if ((parameters == null || parameters.Length == 0) && args == null)
return true;
else if (parameters.Length == args.Length)
{
namespace CryEngine
{
/// <summary>
/// ItemSystem contains scriptbinds used in relation to the item system.
/// </summary>
public class ItemSystem
{
private static IItemSystemMethods _itemSystemMethods;
internal static IItemSystemMethods Methods {
get
using System;
using CryEngine;
namespace CryGameCode.Entities.AngryBoids
{
[Entity(Category = "AngryBoids")]
public class TheBoringOne : AngryBoid
{
public TheBoringOne()
: base()
@samneirinck
samneirinck / gist:2961901
Created June 20, 2012 20:07
CryMono async support
public async void Test()
{
var originalPosition = this.Position;
Debug.Log("Wait 1 second before moving");
await Delay.TimeDelay(TimeSpan.FromSeconds(1));
Debug.Log("Starting to move");
await MoveTo(new Vec3(900, 900, 100), TimeSpan.FromSeconds(3));
Debug.LogAlways("Arrived at destination, moving back");
await MoveTo(originalPosition, TimeSpan.FromSeconds(3));
public class ComplexClass
{
private readonly float _sampleValue;
public float SampleValue
{
get { return _sampleValue; }
}
protected int A { get; set; }
public SerializableClass SerializableProperty { get; set; }
public bool IsFunny
@samneirinck
samneirinck / request.xml
Created July 25, 2015 14:51
Get Volume request
POST /MediaRenderer/RenderingControl/Control HTTP/1.1
HOST: 192.168.0.156:1400
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#GetVolume"
CONTENT-TYPE: text/xml; charset="utf-8"
Content-Length: 380
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:GetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
HTTP/1.1 200 OK
EXT:
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER: Linux UPnP/1.0 Sonos/29.5-91030 (ZPS9)
CONNECTION: close
Content-Length: 288
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">