Not sure I want to put 30000+ lines of code online. But I'll give you some advice. I have all the cards defined in text files which the program parses to understand each card effect step by step (I basically created a unique scripting language for card effects). As for online I used an asset package called Mirror in my Weiss Schwarz simulator and got it working on LAN. Unity is supposed to be coming out with a new multiplayer system, but I haven't heard much about it.