From 5a7681c37ec7f6993d934e29dced5041a41dd6fc Mon Sep 17 00:00:00 2001 From: Giovanni De Gasperis Date: Mon, 22 Sep 2014 22:58:03 +0200 Subject: [PATCH] added specific OpenSim test code --- os-redis-sharp.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/os-redis-sharp.cs b/os-redis-sharp.cs index 833e63e..edf1843 100644 --- a/os-redis-sharp.cs +++ b/os-redis-sharp.cs @@ -925,3 +925,30 @@ public object [] ToArgs () return args.ToArray (); } } + +// just to output a string to the viewer console +void debug(string msg){ + llOwnerSay("debug: "+msg); +} + +// MAIN Script that uses the Redis server + +string message = "Hello avatar!"; +string REDIS_IP = "192.168.1.111"; + +public void default_event_state_entry() +{ + debug(message); +} + +public void default_event_touch_start( + LSL_Types.LSLInteger total_number) +{ + Redis R = new Redis(REDIS_IP); + var info = R.GetInfo (); + foreach (var k in info.Keys) { + llSay(0, (string)k+" "+ info[k]); + } + string value = R.GetString("T3:status"); + debug(value); +}