Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by xboxxxxd · Jan 23, 2016 at 06:19 PM · photonscriptingproblemunityserializer

A MindBreaking MonoBehaviour Issue!. (Unity3D v5.1.0f Pro: unityserializer-ng VS Photon Unity Networking)

EDIT: Maby usefull Question Binded to this problem, Shall i use Unity3D v5.3.x instead of v5.1.x, as in: may it be fixed in that newer version or..?

I am working my but off to Make a Sick game, Loads of people do that, but most of them wil walk into those stupid Problems when making them.

My Problem is about a MonoBehaviour in Combination of Photon Behaviour, This code is by the Photon Config System (PUN > Setup) Edited into a unityserializer-ng Script for Saving/Loading Advanced Game files etc.. but It's that line where the problems start's with, and from there Compiling error's do not display but only the 'Ex' MonoBehaviour get's show in the Console of Unity, It doesnt even show me where the problems actually is at as in Unity and Mono!.

Ive tryed like every possible solution and/or fix to make the script operational and functional again, Was not such of a Success..

After a while i started a Topic on another Development website as results again where no success in any way, Answers, Possible Fixe's, And even a few Modular Dev's failed in helping me. So i thought, i just Directly ask it to the Unity Forum Staff's itself!..

I hope one of you can help me out?..

Well, it has to to with this line as hardly mentioned above:

 public class InheritableRPC : Photon.MonoBehaviour

And the Full Script of the Behaviour aswel:

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using System;
 using System.Linq;
 using System.Runtime.Serialization.Formatters.Binary;
 using System.IO;
 using System.Reflection;
 
 [AddComponentMenu("System/Inheritable RPC Handler")]
 public class InheritableRPC : Photon.MonoBehaviour
 {
     public class CachedRoutine
     {
         public MethodInfo routine;
         public MonoBehaviour behaviour;
     }
     
     private Dictionary<string, List<CachedRoutine>> cache = new Dictionary<string, List<CachedRoutine>>();
     
     [RPC]
     void PerformRPCCall(string routineName, string parameters)
     {
         var b = new BinaryFormatter();
         using(var s = new MemoryStream(Convert.FromBase64String(parameters)))
         {
             var p = (object[])b.Deserialize(s);
             
             if(!cache.ContainsKey(routineName))
             {
                 cache[routineName] = GetComponents<Photon.MonoBehaviour>()
                 .Select(m=> new CachedRoutine { routine = m.GetType().GetMethod(routineName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance), behaviour = m })
                 .Where(r=>r.routine != null && r.routine.IsDefined(typeof(RPC), true))
                 .ToList();
             }
             foreach(var m in cache[routineName])
             {
                 m.routine.Invoke(m.behaviour, p);
             }
         }
     }
 }
 
 
 public static class InheritableRPCExtensions
 {
     public class StoredPlayer
     {
         public string ipAddress, guid;
         public int port;
     }
     
     public static void RPCEx(this PhotonView view, string routineName, PhotonTargets mode, params object[] parameters)
     {
         using(var m = new MemoryStream())
         {
             var b = new BinaryFormatter();
             b.Serialize(m, parameters);
             m.Flush();
             var s = Convert.ToBase64String(m.GetBuffer());
             view.RPC("PerformRPCCall", mode, routineName, s);
         }
     }
     
     public static void RPCEx(this PhotonView view, string routineName, PhotonPlayer player, params object[] parameters)
     {
         using(var m = new MemoryStream())
         {
             var b = new BinaryFormatter();
             b.Serialize(m, parameters);
             m.Flush();
             var s = Convert.ToBase64String(m.GetBuffer());
             view.RPC("PerformRPCCall", player, routineName, s);
         }
     }
 }


Here is an Zipped file of the Plugins DB from: unityserializer-ng Asset, That got converted by Photon:

unityserializer-ng Plugins

And if you need a full Copy of my project, PM me, i wil Try to send the Project in any way possible (may considering doing that into a Live Interactible OnlineDrive Future).

Gr.Djni Wlk, MultiFunctional Developer/Producer.

PS: If i posted this in the wrong Section (Moderators/META/Etc), Tell me instead of directly removing it, I would like to know if it's posted correctly or not, This wil help also in Future'd Posts and Questions etc i may possible need. Just Notify me first atleast, Thx.

openunitytools.zip (296.1 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

40 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I resolve this Photon Error: Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists). 1 Answer

Network lobby manager tutorial +PUN? 0 Answers

Photon Network, synchronize a int over the network. 1 Answer

Rejoin in photon network? 2 Answers

Unity - Photon OnJoinedRoom not being called 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges