[WIP][A16] Realtime networking project

Started by RawCode, April 06, 2017, 03:22:50 AM

Previous topic - Next topic

RawCode

Features:

1) Basic async network stack
2) Basic server<>client infrastructure
3) Basic remote procedure calls (for demonstration purposes it uses http\web for now)
4) Basic async>>sync data processing

code:
https://github.com/RawCode/yaCIL/blob/master/_netLink.cs

demo mod as post attachment

How to use demo?

1) Run game with mod enabled, you will need to load map, it won't activate in pregame GUI
2) type localhost or 127.0.0.1 in your web browser, you will see simple form (screen 1)
3) type name of event, like "ShipChunkDrop", you can get list of event from devconsole or from "core" mod, any event will work fine.
4) event will trigger from 1 to 119 ticks from that moment
5) port and local bind are hardcoded to "localhost:80" for now, if you have 80th port bound game will fail with exception, there are no checks and recovery yet


[attachment deleted by admin due to age]

EnglishMan

Just want to ask is this code still works? I am a novice python programmer and plan to write twitch bot for Rimworld. If it still works and have web interface, I think that would be easy to connect python code with this C# code. I don't know C# at all, so will be glad if someone post a link on compiled dll. Thank you for your time and work, sorry for necropost.

RawCode

project a bit dead for now, i will revive it with proper industrial grade netstack and net to game sync.

rimworld is not any special, you can google any c# networking sample and c# twitch library and test your bot, only issue is passing data from network thread into game thread without blocking main thread (issue not related to rimworld again, it's plain xthread communication that have plenty of industrial solutions)