Malboro Posted April 7, 2019 Share Posted April 7, 2019 Привет! Сегодня поговорим о событиях Ссылка на проект: https://github.com/SirEleot/RageMpTutorial.git Link to comment Share on other sites More sharing options...
Chipu Posted April 19, 2019 Share Posted April 19, 2019 Добрый день, сделал все как у вас, но при запуске появились ошибки. 1) В server.exe не показывает то, что события загрузились 2 ) При входе на сервер появляется окно с ошибкой: server packages could not be compiled successfully! Check clientside_cs.txt for C# logs Содержимое clientside_cs.txt:The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. Ссылка на сам сервер: https://yadi.sk/d/ePF-oJxZiqzXfQ Link to comment Share on other sites More sharing options...
Malboro Posted April 20, 2019 Author Share Posted April 20, 2019 10 часов назад, Chipu сказал: Добрый день, сделал все как у вас, но при запуске появились ошибки. 1) В server.exe не показывает то, что события загрузились 2 ) При входе на сервер появляется окно с ошибкой: server packages could not be compiled successfully! Check clientside_cs.txt for C# logs Содержимое clientside_cs.txt:The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. Ссылка на сам сервер: https://yadi.sk/d/ePF-oJxZiqzXfQ Проблема в том что при динамической сборке проекта, как на клиентской части, нельзя использовать переменные типа var. Проверь свой код клиентской части на их наличие. Вместо var можно использовать dynamic Link to comment Share on other sites More sharing options...
Chipu Posted April 20, 2019 Share Posted April 20, 2019 2 часа назад, Malboro сказал: Проблема в том что при динамической сборке проекта, как на клиентской части, нельзя использовать переменные типа var. Проверь свой код клиентской части на их наличие. Вместо var можно использовать dynamic https://imgur.com/FTmVhtQ Я их вроде не использовал Link to comment Share on other sites More sharing options...
Malboro Posted April 20, 2019 Author Share Posted April 20, 2019 10 минут назад, Chipu сказал: https://imgur.com/FTmVhtQ Я их вроде не использовал public class ClientTest { //ne suda public ClientTest() { Events.OnPlayerChat += OnPlayerChat; Events.Add("cl_TestEvent", OnTestEvent); } Первое что бросается в глаза - не унаследовался от класса Events.Script Link to comment Share on other sites More sharing options...
Chipu Posted April 20, 2019 Share Posted April 20, 2019 3 часа назад, Malboro сказал: public class ClientTest { //ne suda public ClientTest() { Events.OnPlayerChat += OnPlayerChat; Events.Add("cl_TestEvent", OnTestEvent); } Первое что бросается в глаза - не унаследовался от класса Events.Script Да, действительно. Решил сделать рефакторинг проекта. Ошибок теперь же нет, но события не вызываютсяКод: https://yadi.sk/d/SDhAozfIEpGZXQ Link to comment Share on other sites More sharing options...
Malboro Posted April 20, 2019 Author Share Posted April 20, 2019 2 минуты назад, Chipu сказал: Да, действительно. Решил сделать рефакторинг проекта. Ошибок теперь же нет, но события не вызываютсяКод: https://yadi.sk/d/SDhAozfIEpGZXQ Какие именно события не вызываются на клиенте или на сервере, в серверной консоли что-то выводится при подключении? Если не работают клиентские события нужно убедится в наличии файла enable-clientside-cs.txt в папке с Rage Link to comment Share on other sites More sharing options...
Chipu Posted April 20, 2019 Share Posted April 20, 2019 (edited) 2 часа назад, Malboro сказал: Какие именно события не вызываются на клиенте или на сервере, в серверной консоли что-то выводится при подключении? Если не работают клиентские события нужно убедится в наличии файла enable-clientside-cs.txt в папке с Rage Консоль:[N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:13348) ExperimentalWarning: The ESM module loader is experimental. Loading packages Initializing bridge (0.3.7.0).. Initializing Bootstrapper.dll (0.3.7.0).. -> SERVER STARTED AT 20.04.2019 13:00:08 Unable to load acl.xml ACLEnabled: False Loaded 451 entries from vehicleData.json Loading resources.. -> Starting Alpha resource.. Alpha: loading scripts.. found 1 script(s) -> Resource Alpha started! Started! Waiting for connections.. [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. Файл enable-clientside-cs.txt есть - https://imgur.com/BBqVjdq Событие не вызываются как на клиенте, так и на сервере Edited April 20, 2019 by Chipu Link to comment Share on other sites More sharing options...
Malboro Posted April 20, 2019 Author Share Posted April 20, 2019 21 минуту назад, Chipu сказал: Консоль:[N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:13348) ExperimentalWarning: The ESM module loader is experimental. Loading packages Initializing bridge (0.3.7.0).. Initializing Bootstrapper.dll (0.3.7.0).. -> SERVER STARTED AT 20.04.2019 13:00:08 Unable to load acl.xml ACLEnabled: False Loaded 451 entries from vehicleData.json Loading resources.. -> Starting Alpha resource.. Alpha: loading scripts.. found 1 script(s) -> Resource Alpha started! Started! Waiting for connections.. [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. Файл enable-clientside-cs.txt есть - https://imgur.com/BBqVjdq Событие не вызываются как на клиенте, так и на сервере твой meta.xml <meta> <info name="Alpha" type="script"/> <script src="Server"/> </meta> мой <meta> <info name="Tuter" type="script"/> <script src="Server.dll"/> </meta> Link to comment Share on other sites More sharing options...
Chipu Posted April 20, 2019 Share Posted April 20, 2019 2 часа назад, Malboro сказал: твой meta.xml <meta> <info name="Alpha" type="script"/> <script src="Server"/> </meta> мой <meta> <info name="Tuter" type="script"/> <script src="Server.dll"/> </meta> Спасибо, теперь все работает) У вас в видеоролике по серверной стороне src="Server", добавьте примечание, может кто тоже запутается Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now