WebHost: check that worlds system is not loaded in customserver (#2222)
This commit is contained in:
		
							parent
							
								
									812dc413e5
								
							
						
					
					
						commit
						5d47c5b316
					
				| 
						 | 
				
			
			@ -11,6 +11,7 @@ import socket
 | 
			
		|||
import threading
 | 
			
		||||
import time
 | 
			
		||||
import typing
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
import websockets
 | 
			
		||||
from pony.orm import commit, db_session, select
 | 
			
		||||
| 
						 | 
				
			
			@ -164,8 +165,10 @@ def run_server_process(room_id, ponyconfig: dict, static_server_data: dict,
 | 
			
		|||
    db.generate_mapping(check_tables=False)
 | 
			
		||||
 | 
			
		||||
    async def main():
 | 
			
		||||
        import gc
 | 
			
		||||
        if "worlds" in sys.modules:
 | 
			
		||||
            raise Exception("Worlds system should not be loaded in the custom server.")
 | 
			
		||||
 | 
			
		||||
        import gc
 | 
			
		||||
        Utils.init_logging(str(room_id), write_mode="a")
 | 
			
		||||
        ctx = WebHostContext(static_server_data)
 | 
			
		||||
        ctx.load(room_id)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue