Author Topic: Project Reference Challenge: Standalone Server + Unity + Class Library  (Read 148 times)

Kerozard

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 17
    • View Profile
I have a bit of a tricky setup that I need a bit of help with.

I intend to run 3 applications with TNet3:
- Unity as a client
- A standalone application as lobby Server
- A standalone application as game server

I want to tie those together by having one common library that holds the game logic, the IBinarySerializable objects etc.

My challenge now is that I need TNet3 in all four VS projects. I would need the lobby and the game server to use a build with the "STANDALONE" compilation symbol and Unity to use the standard unity build. The common library could technically use either of those. With other libraries in this kind of setup, I used to add the source to the common library and the problem was solved by referencing those in the main project. But since there is conditional compilation involved and the common library is not supposed to have reference to parts of Unity or the server project, I am not sure how to proceed.

Can I solve this somehow? I don't want to start working with symlinks or nested folder structures referencing the same files since that leads to a world of hurt in case you need to refactor anything. My ideal scenario is having everything in a single place and using it from there.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 327
  • -Receive: 1153
  • Posts: 22,063
  • Toronto, Canada
    • View Profile
Re: Project Reference Challenge: Standalone Server + Unity + Class Library
« Reply #1 on: September 16, 2017, 10:57:17 AM »
Standalone means no Unity references. It's what the TNServer project compiles. It creates a stand-alone executable that doesn't know anything about your game or Unity. It's only used to echo packets to their correct destination -- basically a relay server.

If you need game code in there, then it's not stand-alone anymore as it involves modifying the TNet's server (something that while certainly easy and possible, is not advisable). What is it you're trying to do?